package chainOfResponsibility;

/**
 * 责任链模式测试
 */
public class ChainPatternDemo {

    private static AbstractProjectManager getProjectManager() {
        CoderManager coderManager = new CoderManager();
        CTOManager ctoManager = new CTOManager();
        LeaderManager leaderManager = new LeaderManager();
        ctoManager.setNextManager(leaderManager);
        leaderManager.setNextManager(coderManager);
        return ctoManager;
    }

    public static void main(String[] args) {
        AbstractProjectManager projectManager = getProjectManager();
        projectManager.doWork(AbstractProjectManager.DESIGN, "设计工作");
        projectManager.doWork(AbstractProjectManager.ARRANGEMENTS, "安排工作");
        projectManager.doWork(AbstractProjectManager.CODING, "编码工作");
    }
}
